<template>
	<div class="All">

		<div class="center">
			<div class="problem_tit">
				<h1>问题反馈</h1>
			</div>
			<div class="">
				<!-- <quill-editor style="height: 400px;" v-model="goods_introduce"></quill-editor> -->
				<div ref="box"></div>
			</div>

			<div class="sub_btn">
				<el-button type="primary" round @click="submitJSON">提交</el-button>
				<el-button round @click="clearCentent">清空</el-button>
			</div>
		</div>
	</div>
</template>

<script>
	import E from "wangeditor";
	export default {
		data() {
			return {

				// goods_introduce: ''
				editor: '',
			}
		},
		mounted() {

			//初始化      
			this.editor = new E(this.$refs.box);
			this.editor.create();
		},
		methods: {
			submitJSON(){
				let data = this.editor.txt.html()
				this.$axios.post('https://vvv.52ecode.cn/api/v1.Feedback/index', {
					website_id: 1,
					id: JSON.parse(sessionStorage.getItem('InfoMation')).id,
					content: data
				}).then(res => {
					this.editor.txt.clear()
				}).catch(err => {
					console.log(err);
				})
				
			},
			clearCentent(){
				this.editor.txt.clear()
			}
		}
	}
	
</script>

<style lang="scss" scoped>
	.All {
		background-color: #f5f6f8;
		padding: 20px;

		.center {
			.sub_btn {
				margin-top: 20px;
			}

			padding: 20px;
			border-radius: 20px;
			background-color: #fff;
			display: flex;
			flex-direction: column;
		}
	}
</style>
